package org.liurq.springcloud.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GateConfig {
    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder builder){
        RouteLocatorBuilder.Builder routes =   builder.routes();
        routes.route("path_baidu",r -> r.path("/guonei").uri("http://news.baidu.com"));
        routes.route("payment_routh3",r -> r.path("/payment/get/**").uri("http://localhost:8001"));
        return routes.build();
    }
}
